Solutions DeliveredSolutions Delivered SkillsSkills ArticlesArticles AboutAbout ContactContact

Practical Automation with Flow

Published on: June 19, 2025

Flows in Salesforce offer robust automation capabilities, allowing administrators to build complex business processes without writing code. Understanding the different types of flows and their essential elements is key to leveraging their full potential. This article will explore several key flow types, including Screen Flows and Record-Triggered Flows, and delve into the crucial logic and data elements that empower their functionality.

Understanding Flow Types

Salesforce offers various flow types, each designed for specific automation needs:

  • Screen Flows: These are interactive flows that guide users through a series of screens to collect information or display data. They are ideal for processes that require user input, such as creating records, onboarding new employees, or complex data entry forms. It's worth noting that in my experience, Screen Flows, even when inactive, sometimes execute if the user possesses the "manage flows" permission, though I am still looking into other factors that might contribute to this behavior.

  • Record-Triggered Flows: As their name suggests, these flows automatically launch when a record is created, updated, deleted, or upserted. They are powerful for automating background processes that don't require direct user interaction at the time of execution. When debugging Record-Triggered Flows, any changes made will be rolled back and not stored in the database.

  • Schedule-Triggered Flows: These flows run regularly after a particular duration, with a maximum duration of weekly.

  • Platform Event-Triggered Flows: These flows launch when a platform event message is received.

Essential Logic and Data Elements

Building effective flows relies on mastering various elements that control flow behavior and data manipulation:

Logic Elements

Logic elements introduce decision-making and reusability into your flows:

  • Decision: This element allows a flow to take different paths based on defined conditions. You can set conditions using resources, operators, and values to direct the flow's execution.

  • Assignment: Use the Assignment element to assign static or dynamic values to variables. You can also perform add and subtract operations on the value of variables.

  • Subflow: For modularity and reusability, you can add a previously created flow to the current flow. The previously created flow added as a subflow needs to be active. Variables used from the subflow should have the "allow input" and "allow output" box checked, since it is the best practice.

Data Elements

Data elements enable your flows to interact with Salesforce records:

  • Create Records: This element allows you to create new records. You can manually choose the object and the fields, and assign them values to be stored in the new record. The values can be entered by the user in the previous screen element.

  • Get Records: Use this element to get the field values from a single or multiple records. You can filter which records to store in the "Get Records" variable. For example, to store only the current record, you can select the field as 'id' and create a variable in the value to pass the AccountId to that variable from the edit page layout. All settings are also objects and the values of the settings are records. These objects will show up inside the flow builder, and the Get Records element can be used to fetch those records.

  • Update Records: This element updates field values of a pre-existing record. You can select the object from which the records will get updated and filter the records to be updated. You can choose to update the record that triggered the flow or any record related to the object.

  • Delete Records: You can use flows to automatically delete records that meet certain conditions. For instance, a scheduled path can be used to check conditions before deletion, ensuring that Account records that have an opportunity stage as "Closed Won" will not be deleted automatically.

Working with Variables

Variables are crucial for storing and manipulating data within flows:

  • Dynamic Variables: These variables can acquire value from the record page dynamically. To create one, define a new resource as a variable, select its data type (e.g., text), and check "Available for input". On the page editor, check the "Pass record ID into this variable" option under the variable API name. A single variable can be assigned to multiple flows in the decision path since the other subflows need the variable to perform the same function and only one path will be executed depending on the decision.

  • Manual Variables: These can be used to store the Record ID of the newly created record. This is used in the "upload file" element to link the uploaded file to the currently created record.

  • Record Variables (Single/Collection): A record variable with a "Record" data type and object selection can store the individual field values in that object record. If the "Collection" box is checked, this variable can store multiple records and their field values.

Advanced Flow Capabilities

Flows offer further capabilities for enhanced automation:

  • Fast Field Update: For Record-Triggered Flows, this high-performance flow runs before the record is saved to the database. It can only be used to make changes to the record that has triggered the flow.

  • Actions and Related Records: This flow runs after the record is saved to the database. Any record can be updated, created, or updated.

  • Custom Errors: The custom error element is used to display an error message on a specific record or on a specific field of a record. With this element, you can display an error message to the user that a record can't be deleted because of certain conditions.

  • Sending Emails and Notifications: Flows can send emails and custom notifications. Custom notifications make the notification clickable, opening the record responsible for the notification.

  • Post to Chatter: Using the "Post to Chatter" element, you can post to the Chatter feed of the user, group, or record.

  • Invoking Apex: Flows can trigger Apex classes with record-triggered flows. You can search for the Apex class name and provide values to variables.

  • Collection Filter: This element is used to sort the records in the collection variable as per your needs.

By mastering these elements and understanding the nuances of various flow types, Salesforce administrators can build powerful and efficient automations that streamline business processes and improve user experience.